<template>
  <div>
    <h4>我是兄弟B</h4>
    <div>我要接收来自兄弟A的数据:{{ name }}</div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      name: 'Lucy'
    }
  },
  mounted () {
    this.$on('data-a', name => {
      console.log('on');
      console.log(name)
      this.name = name
    })
  }
}
</script>